import { request, BaseResponse } from '@/framework/utils/request';

/**
 * @description 登录
 * @param {LoginParams} data
 * @returns
 */
export function login(data: any) {
  return request<BaseResponse<API.LoginResult>>(
    {
      url: '/authorize/login',
      method: 'post',
      data,
      maxRedirects: 0,
    },
    {
      isGetDataDirectly: false,
    },
  );
}
export const getUserInfo = () => {
  return request(
    {
      url: '/authorize/me',
      method: 'get',
    },
    {
      isGetDataDirectly: false,
    },
  );
};
export const getCaptcha = () => {
  return request(
    {
      url: '/captcha/',
      method: 'get',
    },
    {
      isGetDataDirectly: false,
    },
  );
};
